﻿
using server.DAO;
using server.Model;
using server.Model.WebAdmin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;

namespace Restful
{
     [ServiceContract(Name = "ManagerImp")]
    public  interface IManager
    {
      
        [OperationContract]
        [WebInvoke(Method = "POST",UriTemplate = "AdminLogin/{userName}/{password}/{validateCode}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        Admin AdminLogin(string userName,string password,string validateCode);


        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "ModityAdminPassword/{userID}/{oldPassword}/{repassword}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        int ModityAdminPassword(string userID, string oldPassword, string repassword);

        [OperationContract]
        [WebGet(UriTemplate = "GetUserList?limit={limit}&page={page}&name={name}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        UserReplay GetUserList(string limit,string page,string name);


        [OperationContract]
        [WebGet(UriTemplate = "GetGameList?limit={limit}&page={page}&name={name}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        GrounpReplay GetGameList(string limit, string page, string name);

       [OperationContract]
      [WebInvoke(Method = "POST", UriTemplate = "Test", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
      string Test(string stu);

        [OperationContract]
        [WebGet(UriTemplate = "GetActiveCodeList?limit={limit}&page={page}&code={code}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        CodeReplay GetActiveCodeList(string limit, string page, string code);

      
        [OperationContract]
        [WebGet( UriTemplate = "AddCode/{code}/{codeType}/{note}/{expiretime}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        int AddCode(string code,string codeType,string note,string expiretime);

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "ModifyCode/{id}/{note}/{codeType}/{expiretime}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        int ModifyCode(string id, string note, string codeType,string expiretime);

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "DeleteCode/{id}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        int DeleteCode(string id);

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "SearchCodeById/{id}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        CodeModel SearchCodeById(string id);

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "GetRandomActiveCode", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        int GetRandomActiveCode();

        [OperationContract]
        [WebGet(UriTemplate = "AdminLogOut", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        CodeReplay AdminLogOut();






    }
}
